<?php
declare (strict_types = 1);

namespace app\api\controller;

class Logout extends Auth {

    public function index() {
        $result = false;
        if ($this->token != "") {
            $result = cache(config("redis.token_pre").$this->token, null);
        }
        if ($result) {
            return show(config("status.success"), "退出登录成功");
        }

        return show(config("status.error"), "请求失败，请重试");
    }
}